<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="/src/css/public.css">
</head>

<body>
    <div style="padding: 10px;">
        <form class="layui-form" action="" lay-filter="layui-form-Table">
           <ul class="layui-form layui-form-pane formUl" style="margin: 15px;">
				<li class="layui-form-item">
					<label class="layui-form-label">项目类型</label>
					<div class="layui-input-block">
						<!-- <input type="text" name="itemflag" lay-verify="required"   title="0检查项，1判定项，2原因项。" class="layui-input"> -->
						<select id="itemflag" name="itemflag" lay-filter="itemflag">
							<option value="0" selected="">检查项</option>
							<option value="1">判定项</option>
							<option value="2">原因项</option>
						</select>
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">项目代码 </label>
					<div class="layui-input-block">
						<input type="text" name="daim" autocomplete="off" placeholder="请输入代码（标准里的代码值）"
							class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">检查项目序号</label>
					<div class="layui-input-block">
						<input type="text" name="itemnumber" lay-verify="required" autocomplete="off"
							placeholder="请输入检查项目的序号" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">检查项目名称</label>
					<div class="layui-input-block">
						<input type="text" name="itemname" lay-verify="required" autocomplete="off"
							placeholder="请输入检查项目的名称" class="layui-input">
					</div>
				</li>

				<li class="layui-form-item" id="divisproblem" style="width: 98%;">
					<label class="layui-form-label">判定类型</label>
					<div class="layui-input-block">
						<!-- <input type="text" name="isproblem" placeholder="请输入0、9或3"  autocomplete="off"  class="layui-input">(9：代表发现问题；0：默认值；其他范围1到8) -->
						<input type="radio" name="isproblem" value="0" title="未发现问题" checked="">
						<input type="radio" name="isproblem" value="8" title="合理缺项">
						<input type="radio" name="isproblem" value="9" title="发现问题">
					</div>
				</li>

				<li class="layui-form-item layui-form-text" id="divjcyj" style=" width: 98%;">
					<label class="layui-form-label">检查依据</label>
					<div class="layui-input-block">
						<textarea type="text" name="jcyj" autocomplete="off" placeholder="请输入检查项的检查依据"
							class="layui-textarea"></textarea>
					</div>
				</li>
				<li class="layui-form-item layui-form-text" id="divjcfs">
					<label class="layui-form-label">检查方式</label>
					<div class="layui-input-block">
						<textarea type="text" name="jcfs" autocomplete="off" placeholder="请输入检查项的检查方式"
							class="layui-textarea"></textarea>
					</div>
				</li>
				<li class="layui-form-item layui-form-text" id="divjczn">
					<label class="layui-form-label">检查指南</label>
					<div class="layui-input-block">
						<textarea type="text" name="jczn" autocomplete="off" placeholder="请输入检查项的检查指南"
							class="layui-textarea"></textarea>
					</div>
				</li>
				<li class="layui-form-item" id="divisvoteitem">
					<label class="layui-form-label">是否是否决项</label>
					<div class="layui-input-block">
						<!-- <input type="text" name="isvoteitem" lay-verify="required" autocomplete="off"   class="layui-input"> -->
						<input type="radio" name="isvoteitem" value="0" title="否" checked="">
						<input type="radio" name="isvoteitem" value="1" title="是">
					</div>
				</li>
				<!-- <li class="layui-form-item" id="divscore">
					<label class="layui-form-label">分值</label>
					<div class="layui-input-block">
						<input type="text" name="score" lay-verify="sort" autocomplete="off" placeholder="请输入检查项目分值"
							class="layui-input">
					</div>
				</li> -->
				<li class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" name="paixu" lay-verify="required" autocomplete="off" placeholder="请输入排序"
							class="layui-input">
					</div>
				</li>
			</ul>

        </form>
    </div>
    <script src="/layui/layui.js"></script>
     <script>
        layui.config({
			base: '/src/'
		}).use('index', function () {
			var admin = layui.admin
				, main = layui.main
				, form = layui.form
				, table = parent.table;
var $ = layui.$;
			$('#divisproblem').hide();

			form.on('select(itemflag)', function (data) {
				var val = data.value;
				if (val === "0") {
					$('#divdaim').show();
					$('#divscore').show();
					$('#divisvoteitem').show();
					$('#divisproblem').hide();

					$('#divjcfs').show();
					$('#divjczn').show();
					$('#divjcyj').show();

				}
				else if (val === "1") {
					$('#divdaim').hide();
					$('#divscore').hide();
					$('#divisvoteitem').hide();
					$('#divisproblem').show();

					$('#divjcfs').hide();
					$('#divjczn').hide();
					$('#divjcyj').hide();


				}
				else if (val === "2") {
					$('#divdaim').hide();
					$('#divscore').hide();
					$('#divisvoteitem').hide();
					$('#divisproblem').hide();

					$('#divjcfs').hide();
					$('#divjczn').hide();
					$('#divjcyj').hide();

				}
			});

			//加载表单内容
			admin.req({
				url: 'jdjc/jcxm/Edit'
				, type: 'get'
				, data: { id: main.getPageParams('id') }
				, done: function (res) {
					if (res.successful) {
						form.val("layui-form-Table", {
							"id": res.data.id
							, "itemnumber": res.data.itemnumber
							, "itemname": res.data.itemname
							, "jcyj": res.data.jcyj
							, "jcfs": res.data.jcfs
							, "jczn": res.data.jczn
							// ,"parentid": res.data.parentid
							// ,"parentpath": res.data.parentpath
							// ,"depth": res.data.depth
							, "paixu": res.data.paixu
							, "isvoteitem": res.data.isvoteitem
							, "isproblem": res.data.isproblem
							, "itemflag": res.data.itemflag
							// ,"jcxmflag": res.data.jcxmflag

							, "score": res.data.score
							// ,"daim": res.data.daim
						});
						if (res.data.itemflag === "0") {
							$('#divdaim').show();
							$('#divscore').show();
							$('#divisvoteitem').show();
							$('#divisproblem').hide();

							$('#divjcfs').show();
							$('#divjczn').show();
							$('#divjcyj').show();

						}
						else if (res.data.itemflag === "1") {
							$('#divdaim').hide();
							$('#divscore').hide();
							$('#divisvoteitem').hide();
							$('#divisproblem').show();

							$('#divjcfs').hide();
							$('#divjczn').hide();
							$('#divjcyj').hide();
						}
						else if (res.data.itemflag === "2") {
							$('#divdaim').hide();
							$('#divscore').hide();
							$('#divisvoteitem').hide();
							$('#divisproblem').hide();

							$('#divjcfs').hide();
							$('#divjczn').hide();
							$('#divjcyj').hide();

						}

					}
				}
			});
  });
    </script>
</body>

</html>